package com.ihr360.cnb.module.oneclick.service;


import com.ihr360.cnb.module.oneclick.service.fallback.OneClickServiceFallback;
import com.ihr360.commons.entity.AuthUserInfo;
import com.ihr360.commons.vo.ResultInfo;
import com.ihr360.oneclick.entity.Spreadsheet;
import com.ihr360.oneclick.entity.StaffRecord;
import com.ihr360.oneclick.modal.ExcelImportContext;
import com.ihr360.oneclick.request.SaveExcelDataRequest;
import com.ihr360.oneclick.request.SpreadsheetImportRequest;
import com.ihr360.oneclick.vo.StaffMonthMessageVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 一键工资条接口
 *
 * @author tom
 * @date 17-6-21
 */

@FeignClient(name = "ihr360-one-click-provider", fallback = OneClickServiceFallback.class)
public interface OneClickService {

    /**
     * excel data parse
     *
     * @param spreadsheetImportRequest
     * @return
     */
    @PostMapping(value = "/spreadsheet/excel/data/parse")
    ResultInfo<ExcelImportContext> excelDataParse(@RequestBody SpreadsheetImportRequest spreadsheetImportRequest);

    /**
     * 获取excel导入的员工名录 list
     *
     * @param spreadsheet
     * @return
     */
    @PostMapping(value = "/spreadsheet/excel/data/staff/list")
    ResultInfo<List<StaffRecord>> getExcelImportStaffList(@RequestBody Spreadsheet spreadsheet);

    /**
     * 保存导入数据
     *
     * @param saveExcelDataRequest
     * @return
     */
    @PostMapping(value = "/spreadsheet/excel/data/save")
    ResultInfo<Spreadsheet> saveExcelData(@RequestBody SaveExcelDataRequest saveExcelDataRequest);


  /*  *//**
     * excel data save
     *
     * @param excelImportContext
     * @return
     *//*
    @PostMapping(value = "/spreadsheet/excel/data/save")
    ResultInfo<Spreadsheet> saveExcelData(@RequestBody ExcelImportContext excelImportContext);
*/
    /**
     * 查询员工一键工资条的所有月份
     *
     * @param functionId
     * @param authUserInfo
     * @return
     */
    @PostMapping("/function/staff/month/list")
    List<String> getFunctionDataMonthList(@RequestParam(value = "functionId") String functionId,
                                                  @RequestBody AuthUserInfo authUserInfo);

    /**
     * 获取数据详情
     *
     * @param functionId
     * @param groupId
     * @param authUserInfo
     * @return
     */
    @PostMapping("/function/staff/data")
    StaffMonthMessageVo getFunctionStaffDataByMonth(@RequestParam(value = "functionId") String functionId,
                                                    @RequestParam(value = "groupId") String groupId,
                                                    @RequestBody AuthUserInfo authUserInfo);

    /**
     * 获取员工名录信息
     *
     * @param authUserInfo
     * @return
     */
    @PostMapping("/staff/info")
    StaffRecord getStaffRecord(@RequestBody AuthUserInfo authUserInfo);

    @PostMapping("/spreadsheet/function/staff/checkName")
    void checkLastName(@RequestParam(value = "functionId") String functionId,@RequestBody AuthUserInfo authUserInfo);


}

